import request from '@/utils/request'

// 更新用户个人资料
export const updateUserProfile = (data: Partial<UserInfo>) => {
  return request.put('/api/v1/user/profile', data)
}

// 获取用户信息
export const getUserInfo = () => {
  return request.get('/api/v1/auth/userinfo')
}

// 修改密码
export const changePassword = (data: {
  oldPassword: string
  newPassword: string
  confirmPassword: string
}) => {
  return request.put('/api/v1/user/password', data)
}

// 获取用户操作日志列表
export const getUserOperationLogs = (
  params: UserOperationLogQueryParams
): Promise<UserOperationLogListResponse> => {
  return request.get('/user/operation-logs', params)
}
